from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import time
import json

options = Options()
#options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-gpu')
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(options, service)

link = "https://sso.cuc.edu.cn/"

driver.get(link)

time.sleep(60)

driver.refresh()
cookies = driver.get_cookies()
with open("cookies.json", "w") as f:
    json.dump(cookies, f)

